import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { NgZorroIopModule } from 'ng-zorro-iop';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {FcsServiceStateGuard} from '../authentication/fcs-service-guard';

const FCS_ROUTES: Routes = [
  {
    path: '',
    redirectTo: '/function',
    pathMatch: 'full'
  },
  {
    path: 'state',
    redirectTo: '/function',
    pathMatch: 'full'
  },
  {
    path: 'function',
    loadChildren: './function/function.module#FunctionModule',
    //canActivateChild: [FcsServiceStateGuard]
  },
  {
    path: 'trigger',
    loadChildren: './trigger/trigger.module#TriggerModule',
    //canActivateChild: [FcsServiceStateGuard]
  }
];

@NgModule({
  imports: [
    CommonModule,
      RouterModule.forChild(FCS_ROUTES),
      FormsModule,
      ReactiveFormsModule,
      NgZorroAntdModule,
      NgZorroIopModule,
    ],
  declarations: [],
  providers:[
    FcsServiceStateGuard
  ]
})
export class FcsManageModule { }
